<?php
    require_once("BaseDataAdapter.php");
    class FileDataAdapter  extends BaseDataAdapter {

        function Select($file) {
            if(!is_dir($this->dirname)) return '';
            
            $this->_XMLService->getXMLDataDOM($this->dirname,$file,&$sItemName,&$sPhotoalbumDescription);
            $ItemImageFile = new ItemImageFile();
                
            $ItemImageFile->fileName = $file;
            $ItemImageFile->name = $sItemName;
            $ItemImageFile->description = $sPhotoalbumDescription;
            
            return $ItemImageFile;
        }
        
        function Update($fileObject) {
            if(!is_dir($this->dirname)) return '';
            $this->_XMLService->UpdateXMLDataDOM($this->dirname,$fileObject->fileName,$fileObject->fileName,$fileObject->name,$fileObject->description);
        }
       
        function Insert($fileObject,$source_filename) {
            if(!is_dir($this->dirname)) return '';
            
            $this->_fileSystem->File_Upload($source_filename, $this->dirname, $fileObject->fileName);
            $this->_XMLService->InsertXMLDataDOM($this->dirname,$fileObject->fileName,$fileObject->name,$fileObject->description);
        }
        
        function Delete($item) {
            $this->_fileSystem->File_Delete($this->dirname,$item);
            $this->_XMLService->DeleteXMLDataDOM($this->dirname,$item);
        }
        
        
        
    }

?>
